package com.pep.mgmt.repo;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;

import com.pep.mgmt.model.entity.VrfEntity;

import jakarta.transaction.Transactional;
import java.util.List;


public interface VrfMgmtRepo extends JpaRepository<VrfEntity, Long> {

    @Transactional
	@Modifying
    //@Query("delete from VrfEntity vrfEntity where (vrfEntity.vrfName = ?1)")
    void deleteAllByVrfName(String vrfName);

    List<VrfEntity> findByVrfName(String vrfName);

    Long countByVrfNameAndVlanId(String vrfName, int vlanId);

}
